import Taro, { Component } from "@tarojs/taro";
import { View } from "@tarojs/components";
import {connect} from '@tarojs/redux'

import AddMissionModal from "../../components/AddMissionModal/addMissionModal";
import OverridePlanModal from "../../components/OverridePlanModal/overridePlanModal";
import AddWorkModal from '../../components/AddWorkModal/addWorkModal'

@connect(
    state=>state
)
class Modals extends Component {
  render() {
    return (
      <View>
        {this.props.makePlan.addMission ? <AddMissionModal /> : null}
        {this.props.makePlan.unsubmitedPlans &&
        this.props.makePlan.unsubmitedPlans[1].length !== 0 ? (
          <OverridePlanModal />
        ) : null}
        {this.props.workToDo.showAddWorkModal?(<AddWorkModal />):null}
      </View>
    );
  }
}

export default Modals;
